﻿using System;
using System.Collections.Generic;
using System.Text;
using DDotNet.Data.BusinessObjects.Core;
using DDotNet.Data.CodeGen.Model.Entity;
using DDotNet.Data.CodeGen.Model.Factory.Criteria;

namespace DDotNet.Data.CodeGen.Model.Factory
{
    /// <summary>
    /// Factory Abstrata de Usuários
    /// </summary>
    public class UserFactory
    {
        /// <summary>
        /// Retorna um Novo Usuário
        /// </summary>
        /// <returns></returns>
        public static User NewUser()
        {
            return DataPortal.Create<User>(null);
        }
        
        /// <summary>
        /// Recupera um Usuário pela Chave Primária
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        public static User GetUser(int userID)
        {
            return DataPortal.Create<User>(new UserPKCriteria(typeof(User), userID));
        }
    }
}
